package com.sise.wangzhan;

import com.netflix.loadbalancer.IPing;
import com.netflix.loadbalancer.PingUrl;
import com.netflix.loadbalancer.Server;

/**
 * @Classname MyPing
 * @Description TODO
 * @Date 2020/3/26 17:57
 * @Created by wangzhan
 */
public class MyPing implements IPing {

    /***
     *
     * @Description TODO 设置端口号是默认开启的
     * @param server
     * @date  16:47
     * @return
     *
     */
    @Override
    public boolean isAlive(Server server) {
        /*PingUrl pingUrl = new PingUrl();
        pingUrl.isAlive(server);
        System.out.println("isAlive:"+pingUrl.isAlive(server));
        return pingUrl.isAlive(server);*/
        System.out.println("自定义Ping，服务端口："+server.getHostPort());

        return true;
    }
}
